/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * GenericDialog.java
 *
 * Created on Apr 9, 2011, 1:57:52 PM
 */
package fss.client.ui;

import javax.swing.border.BevelBorder;

/**
 *
 * @author hieu
 */
public class GenericDialog extends javax.swing.JDialog
{

  /** Creates new form GenericDialog */
  public GenericDialog(String aMessage)
  {
    initComponents();
    setModal(true);
    setAlwaysOnTop(true);
    messageText.setEditable(false);
    messageText.setText(aMessage);
    messageText.setBorder(new BevelBorder(BevelBorder.LOWERED));
  }

  /** This method is called from within the constructor to
   * initialize the form.
   * WARNING: Do NOT modify this code. The content of this method is
   * always regenerated by the Form Editor.
   */
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    okayButton = new javax.swing.JButton();
    jScrollPane1 = new javax.swing.JScrollPane();
    messageText = new javax.swing.JTextArea();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("Message");

    okayButton.setText("OK");
    okayButton.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        okayButtonActionPerformed(evt);
      }
    });

    messageText.setColumns(20);
    messageText.setLineWrap(true);
    messageText.setRows(5);
    messageText.setWrapStyleWord(true);
    jScrollPane1.setViewportView(messageText);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(layout.createSequentialGroup()
        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addGroup(layout.createSequentialGroup()
            .addGap(109, 109, 109)
            .addComponent(okayButton, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE))
          .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 301, Short.MAX_VALUE)))
        .addContainerGap())
    );
    layout.setVerticalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
        .addComponent(okayButton)
        .addContainerGap())
    );

    pack();
  }// </editor-fold>//GEN-END:initComponents

    private void okayButtonActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_okayButtonActionPerformed
    {//GEN-HEADEREND:event_okayButtonActionPerformed
      dispose();
    }//GEN-LAST:event_okayButtonActionPerformed

  // Variables declaration - do not modify//GEN-BEGIN:variables
  private javax.swing.JScrollPane jScrollPane1;
  private javax.swing.JTextArea messageText;
  private javax.swing.JButton okayButton;
  // End of variables declaration//GEN-END:variables
}
